<template>
<div>

</div>






</template>


<script setup>
import { onMounted } from 'vue';
import axios from 'axios';
import { useRouter, useRoute} from 'vue-router';
const router = useRouter();
const route = useRoute();
const code = route.query.code;

const huidiao = () => {
    axios.post('http://127.0.0.1:8000/user/dinglogin/3/',{code:code})
    .then(res=>{
        console.log(res.data)
        localStorage.setItem('token',res.data.data.token)
        localStorage.setItem('user_id',res.data.data.userid)
        if(res.data.data.code == 200){
            router.push('/')
        }
    })
}

onMounted(()=>{
    huidiao()
})






</script>